package com.yjymm.commonsdk.controller;

import com.yjymm.commonsdk.common.annotation.Permission;
import com.yjymm.commonsdk.common.annotation.Permissions;
import com.yjymm.commonsdk.common.aop.PermissionAop;
import com.yjymm.commonsdk.common.handler.RoleNamePermissionVerifier;
import com.yjymm.commonsdk.config.PermissionConfig;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author panhaoxiong
 * @date 2021-02-07 18:02
 */
@RestController
public class HelloController {

    @Resource
    PermissionConfig permissionConfig;


    @GetMapping("/he")
    @Permissions(
            {
                    @Permission(propertyName = "role", propertyValue = "ROLE_ADMIN"),
                    @Permission(propertyName = "username", propertyValue = "halou")
            })
    public String hello() {
        System.out.println(permissionConfig);
        return "hello";
    }

}
